package com.xmkj.carwash;

import android.view.View;
import android.widget.ImageView;

import com.common.mvp.BaseMvpActivity;
import com.common.mvp.BasePresenter;

import java.util.concurrent.TimeUnit;

import rx.Observable;
import rx.android.schedulers.AndroidSchedulers;
import rx.functions.Action1;

/**
 * @desc:         启动页界面
 * @author:       Leo
 * @date:         2016/12/23
 */
public class SplashActivity extends BaseMvpActivity
{
    private ImageView ivSplash;


    @Override
    public int getLayoutId() {
        return R.layout.activity_splash;
    }

    @Override
    protected void onViewCreated() {

    }

    @Override
    protected void setNavigation() {
        super.setNavigation();
        m_statusBar.setVisibility(View.GONE);
    }

    @Override
    protected BasePresenter createPresenterInstance() {
        return null;
    }



    @Override
    protected void doLogicFunc()
    {
        Observable.timer(1500, TimeUnit.MILLISECONDS)
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new Action1<Long>()
                {
                    @Override
                    public void call(Long aLong)
                    {
                        gotoActivity(MainActivity.class);
                        finish();
                    }
                });
    }

}